package com.laiketui.order.utils;

public class DataMasking {

    // 对字符串进行简单的脱敏处理，例如用星号(*)替换字符
    public static String maskString(String original, int showFront) {
        if (original == null || original.isEmpty()) {
            return original;
        }
        int length = original.length();
        String mask = "";
        for (int i = 0; i < length; i++) {
            if (i < showFront) {
                mask += original.charAt(i);
            } else {
                mask += "*"; // 其余部分使用星号代替
            }
        }
        return mask;
    }

}
